package com.lkd.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lkd.base.BaseController;
import com.lkd.base.ResponseResult;
import com.lkd.domain.VendingMachine;
import com.lkd.pageParam.VendingMachinePageParam;
import com.lkd.service.IVendingMachineService;
import com.lkd.vo.NodeDetailsVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author author
 * @since 2025-02-09
 */
@RestController
@Api("设备管理相关接口")
@RequestMapping("/api/vm-service/vm")
public class VendingMachineController extends BaseController {
    @Autowired
    private IVendingMachineService vendingMachineService;
    @ApiOperation("设备搜索")
    @GetMapping("/search")
    public ResponseResult<Page<NodeDetailsVo>> search(VendingMachinePageParam param){
        Page<NodeDetailsVo> page =  vendingMachineService.search(param);
      return   success(page);
    }
    @ApiOperation("设备新增")
    @PostMapping
    public ResponseResult add(@RequestBody VendingMachine vendingMachine){
        vendingMachineService.insert(vendingMachine);
        return   success();
    }
}
